<template>
  <div>
    <div class="borderType_title" v-if="title">
      <p style="margin-top: 0;">{{ title }}</p>
    </div>
    <div class="borderType" :style="{width: widthAuto ? '100%':'fit-content;'}">
      <span class="border row1"></span>
      <span class="border row2"></span>
      <span class="border col1"></span>
      <span class="border col2"></span>
      <div class="borderType_content">
        <slot></slot>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    title: [String],
    widthAuto: Boolean
  },
  data() {
    return {}
  },
}
</script>
<style scoped>
.borderType {
  position: relative;
  width: fit-content;
  height: auto;
  border: 1px solid #0063ba;
  background: rgba(4,89,168, 0.7);
  padding: 10px 10px;
}
.border {
  position: absolute;
  padding: 5px;
  border-style: solid;
  border-color: #2bccff;
}
.row1 {
  border-width: 4px 0 0 4px;
  top: -1px;
  left: -1px;
}
.row2 {
  border-width: 4px 4px 0 0;
  top: -1px;
  right: -1px;
}
.col1 {
  border-width: 0 0 4px 4px;
  bottom: -1px;
  left: -1px;
}
.col2 {
  border-width: 0 4px 4px 0;
  bottom: -1px;
  right: -1px;
}
.borderType_title {
  width: 100%;
  background-image: url('../../assets/layout/borderTitle.png');
  background-size: contain;
  background-position: left bottom;
  background-repeat: no-repeat;
  height: 30px;
  font-size: 18px;
  color: #afdaf1;
  padding-left: 15px;
  margin-bottom: 5px
}
.borderType_content {
  width: 100%;
  height: auto;
}
</style>